package QC.MessageBox.beans.wxmsg;

/**
 * Created by Andaren on 2017/4/27.
 * Used for: 消息基本消息
 */
public abstract class BaseWXMsg {

    // 微信加密消息格式化
    private static StringBuffer cryptBuffer = new StringBuffer()
            .append("<xml><ToUserName><![CDATA[%1$s]]></ToUserName><Encrypt><![CDATA[%2$s]]></Encrypt></xml>");

    private String toUserName;  // 开发者微信号(原始账号)
    private String fromUserName;// 发送方帐号（一个OpenID）
    private String createTime;  // 消息创建时间 （整型）
    private String msgType;     // 消息类型（测试Text）
    private String msgId;       // 消息ID

    public String getToUserName() {
        return toUserName;
    }

    public BaseWXMsg setToUserName(String toUserName) {
        this.toUserName = toUserName;
        return this;
    }

    public String getFromUserName() {
        return fromUserName;
    }

    public BaseWXMsg setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
        return this;
    }

    public String getCreateTime() {
        return createTime;
    }

    public BaseWXMsg setCreateTime(String createTime) {
        this.createTime = createTime;
        return this;
    }

    public String getMsgType() {
        return msgType;
    }

    public BaseWXMsg setMsgType(String msgType) {
        this.msgType = msgType;
        return this;
    }

    public String getMsgId() {
        return msgId;
    }

    public BaseWXMsg setMsgId(String msgId) {
        this.msgId = msgId;
        return this;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("BaseWXMsg{");
        sb.append("toUserName='").append(toUserName).append('\'');
        sb.append(", fromUserName='").append(fromUserName).append('\'');
        sb.append(", createTime='").append(createTime).append('\'');
        sb.append(", msgType='").append(msgType).append('\'');
        sb.append(", msgId='").append(msgId).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
